﻿using System;
using System.IO;
using System.Windows.Markup;
using System.Collections.Generic;


namespace Petra
{
  public static class Gis
  {

    private static Petra.Gis.Document _xDoc;




    public static Petra.Gis.Document Document
    {
      get { return _xDoc; }
      //set { _xDoc = value; }
    }




    public static bool LoadDocument(Stream docStr)
    {
      try
      {
        _xDoc = (Petra.Gis.Document)XamlReader.Load(docStr);
        return true;
      }
      catch { return false; }

    }





    public static void SaveDocument(string fileName)
    {
      FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
      XamlWriter.Save(_xDoc, fs);
    }
  }
}
